import request from '@/utils/request'


/**
 * 新增影院
 * @param cinema
 * @returns {*}
 */
export function addCinema(cinema) {
  return request({
    url: '/ticket-cinema/api/v1/cms/cinema',
    method: "post",
    data: cinema
  })
}

/**
 * 新增影厅
 * @param room
 * @returns {*}
 */
export function addRoom(room) {
  return request({
    url: '/ticket-cinema/api/v1/cms/room',
    method: "post",
    data: room
  })
}

/**
 * 更新影院信息
 * @param cinema
 * @returns {*}
 */
export function updateCinema(cinema) {
  return request({
    url: '/ticket-cinema/api/v1/cms/cinema',
    method: 'put',
    data: cinema
  })
}

/**
 * 禁用影院
 * @param cinemaId
 * @returns {*}
 */
export function deleteCinema(cinemaId) {
  return request({
    url: '/ticket-cinema/api/v1/cms/cinema?cinemaId='+cinemaId,
    method: 'delete'
  })
}

/**
 * 根据地名筛选影院
 * @param params
 * @returns {*}
 */
export function filterCinemasBy(params) {
  return request({
    url: '/ticket-cinema/api/v1/cms/cinemas',
    method: 'get',
    params: params
  })
}

/**
 * 根据影院获取影厅
 * @param cinemaId
 * @returns {*}
 */
export function listRoomsByCinemaId(cinemaId) {
  return request({
    url: '/ticket-cinema/api/v1/cms/rooms?cinemaId='+cinemaId,
    method: 'get'
  })
}


/**
 * 根据省市县名筛选相关地点
 * @param params
 * @returns {*}
 */
export function filterLocationsBy(params) {
  return request({
    url: '/ticket-cinema/api/v1/lms/locations',
    method: 'get',
    params: params
  })
}

/**
 * 根据地名筛选影院
 * @param params
 * @returns {*}
 */
export function filterAvailableCinemasBy(params) {
  return request({
    url: '/ticket-cinema/api/v1/cms/outer/cinemas',
    method: 'get',
    params: params
  })
}


